﻿using System;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using MoneyBook.Web.Assets.Resources;

namespace MoneyBook.Web.Models {
    public partial class Member {

        private string _password;

        [Required(ErrorMessageResourceName = "ValidationErrorRequiredField", ErrorMessageResourceType = typeof(Strings))]
        [StringLength(128, MinimumLength = 6, ErrorMessageResourceName = "ValidationErrorStringLengthMinAndMax", ErrorMessageResourceType = typeof(Strings))]
        [Display(Name = "Password", ResourceType = typeof(Strings))]
        [DataMember]
        public string Password {
            get {
                return _password;
            }
            set {
#if !SILVERLIGHT
                _password = value;
#else
                if (_password != value) {
                    ValidateProperty("Password", value);
                    _password = value;
                    RaiseDataMemberChanged("Password");
                }
#endif
            }
        }

    }
}